require(["../../conf/config.js"], function() {
	require(["jquery", "swiper", "common","hover","city","search"], function($, Swiper, com,hover,city,search) {
		console.log("加载页面");
		// 获取热门城市数据
		// let req=new XMLHttpRequest();
		// req.open("get","http://localhost:9999/abc");
		// req.send();
		// req.onload=function(){
		// 	// 热门城市
		// 	let data=JSON.parse(req.response);
		// 	let hotcity=data.HotCity;
		// 	let hotname=[];
		// 	for(let i=0;i<hotcity.length;i++){
		// 		hotname.push(hotcity[i].AreaName);
		// 	}
		// 	console.log(hotname);
		// 	let html="";
		// 	for(let j=0;j<hotname.length;j++){
		// 	  html += `
		// 				<a href="javascript:;">
		// 					${hotname[j]}
		// 				</a>
		// 				`;	
		// 	}
		// 	$(".city-hot").append(html);
		// 	//A
		// 	let city1=data.City1;
		// 	let cityA=city1.A;
		// 	console.log(cityA);
		// 	let htmlA=""
		// 	cityA.forEach((t)=>{
		// 		htmlA += `
		// 								<a href="javascript:;">
		// 									${t.AreaName}
		// 								</a>
		// 								`;	
		// 		;
		// 	}) 
		// 	$(".Acity").append(htmlA);
		// 	//B
		// 	let cityB=city1.B;
		// 	console.log(cityB);
		// 	let htmlB=""
		// 	cityB.forEach((t)=>{
		// 		htmlB += `
		// 								<a href="javascript:;">
		// 									${t.AreaName}
		// 								</a>
		// 								`;	
		// 		;
		// 	}) 
		// 	$(".Bcity").append(htmlB);
		// 	//C
		// 	let cityC=city1.C;
		// 	console.log(cityC);
		// 	let htmlC=""
		// 	cityC.forEach((t)=>{
		// 		htmlC += `
		// 								<a href="javascript:;">
		// 									${t.AreaName}
		// 								</a>
		// 								`;	
		// 		;
		// 	}) 
		// 	$(".Ccity").append(htmlC);
		// 	
		// 	//点击
		// 	$(".citylist dd a").click(function(){
		// 		$(".city-con").css({
		// 			"display":"none";
		// 		});
		// 		console.log($(".city-name").innerHTML);
		// 		$(".city-name").innerHTML=$(this).innerHTML;
		// 	});
		// }
		// // 字母移动
		//  $(".citytab span").mouseover(function () {
		//     let index = $(this).index(".citytab span");
		//     $(this).addClass("active").siblings().removeClass("active");
		//     $($(".citylist")[index]).addClass("active").siblings().removeClass("active");
		// });
		// 
		//

		// 楼层1
		let req1 = new XMLHttpRequest();
		req1.open("get", "http://localhost:9999/pages/floor/F1/F1.html");
		req1.send();
		req1.onload = function() {
			let data = req1.response;
			$("#t01_channelHome").append(data);
		}
		// 楼层2
		let req2 = new XMLHttpRequest();
		req2.open("get", "http://localhost:9999/pages/floor/F2/F2.html");
		req2.send();
		req2.onload = function() {
			let data = req2.response;
			$("#t02_channelHome").append(data);
		}
		// 楼层3
		let req3 = new XMLHttpRequest();
		req3.open("get", "http://localhost:9999/pages/floor/F3/F3.html");
		req3.send();
		req3.onload = function() {
			let data = req3.response;
			$("#t03_channelHome").append(data);
		}
		// 楼层4
		let req4 = new XMLHttpRequest();
		req4.open("get", "http://localhost:9999/pages/floor/F4/F4.html");
		req4.send();
		req4.onload = function() {
			let data = req4.response;
			$("#t04_channelHome").append(data);
		}
		// 楼层5
		let req5 = new XMLHttpRequest();
		req5.open("get", "http://localhost:9999/pages/floor/F5/F5.html");
		req5.send();
		req5.onload = function() {
			let data = req5.response;
			$("#t05_channelHome").append(data);
		}
		// 楼层6
		let req6 = new XMLHttpRequest();
		req6.open("get", "http://localhost:9999/pages/floor/F6/F6.html");
		req6.send();
		req6.onload = function() {
			let data = req6.response;
			$("#t06_channelHome").append(data);
		}
		// 楼层7
		let req7 = new XMLHttpRequest();
		req7.open("get", "http://localhost:9999/pages/floor/F7/F7.html");
		req7.send();
		req7.onload = function() {
			let data = req7.response;
			$("#t07_channelHome").append(data);
		}
		// 楼层8
		let req8 = new XMLHttpRequest();
		req8.open("get", "http://localhost:9999/pages/floor/F8/F8.html");
		req8.send();
		req8.onload = function() {
			let data = req8.response;
			$("#t08_channelHome").append(data);
		}
		// 楼层9
		let req9 = new XMLHttpRequest();
		req9.open("get", "http://localhost:9999/pages/floor/F9/F9.html");
		req9.send();
		req9.onload = function() {
			let data = req9.response;
			$("#t09_channelHome").append(data);
		}


		$.fn.anchorGoWhere = function(options) {
			var obj = jQuery(this);
			var defaults = {
				target: 0,
				timer: 500
			};
			var o = jQuery.extend(defaults, options);
			obj.each(function(i) {
				jQuery(obj[i]).click(function() {
					var _rel = jQuery(this).attr("href").substr(1);
					switch (o.target) {
						case 1:
							var _targetTop = jQuery("#" + _rel).offset().top;
							jQuery("html,body").animate({
								scrollTop: _targetTop
							}, o.timer);
							break;
						case 2:
							var _targetLeft = jQuery("#" + _rel).offset().left;
							jQuery("html,body").animate({
								scrollLeft: _targetLeft
							}, o.timer);
							break;
					}
					return false;
				});
			});
		};
		$(document).ready(function() {
			$(".goTop").anchorGoWhere({
				target: 1
			});
		});
		$(function() {
			var gao = ($(window).height() / 2);

			$(window).scroll(function() {
				var totop = $(this).scrollTop();
				if (totop >= 500) {
					$('.goTop').css('display', 'block');
				} else {
					$('.goTop').css('display', 'none');
				};
			})
		});

		//适应分辨率
		var screenWidth = window.screen.width;
		if (screenWidth < 1300) {
			//document.write()
			$('.w').addClass('w1280');
		}


	})
})
